#include<stdio.h>
#include<algorithm>
#include<math.h>
#define RATIO 0.6180339887498949
using namespace std;

int n, a[30005], x, y;
double ans = 999999999;

int main() {
    scanf("%d", &n);
    for(int i = 1; i <= n; ++i) {
        scanf("%d", a + i);
    }
    sort(a + 1, a + 1 + n);
    for(int i = 2; i <= n; ++i) {
        int right = i - 1, left = 0;
        double diff = a[i] * RATIO;
        while(right - left > 1) {
            int mid = (right + left) / 2;
            if(a[mid] <= diff) {
                left = mid;
            } else {
                right = mid;
            }
        }
        if(fabs(diff - a[right - 1]) < ans) {
            ans = fabs(diff - a[right - 1]);
            x = a[i];
            y = a[right-1];
        }
        if(fabs(diff - a[right]) < ans) {
            ans = fabs(diff - a[right]);
            x = a[i];
            y = a[right];
        }
        
    }
    printf("%d\n%d", y, x);
    return 0;
}
